numa: Correct handling node with CPU populated but no memory populated
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 28 Dec 2009 09:36:51 +0000 (09:36 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 28 Dec 2009 09:36:51 +0000 (09:36 +0000)
commit13d0032801beedd1e04ffd06b4a520296eddba6f
treeca9dff66e309833129427eb9b0415308811253ca
parent5454f280cdd770c9394ac9a430a477e8b63e16a6
numa: Correct handling node with CPU populated but no memory populated

In changeset 20599, the node that has no memory populated is marked
parsed, but not online. However, if there are CPU populated in this
node, the corresponding CPU mapping (i.e. the cpu_to_node) is still
setup to the offline node, this will cause trouble for memory
allocation.

This patch changes the init_cpu_to_node() and srant_detect_node(), to
considering the node is offlined situation.

Now the apicid_to_node is only used to keep the mapping between
cpu/node provided by BIOS, and should not be used for memory
allocation anymore.

One thing left is to update the cpu_to_node mapping after memory
populated by memory hot-add.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
xen/arch/x86/numa.c
xen/arch/x86/setup.c
xen/arch/x86/smpboot.c
xen/arch/x86/x86_64/mm.c